package com.wc.acwing.思维.拐杖糖盛宴;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2025/2/24 23:50
 * @description
 * https://www.acwing.com/problem/content/description/5440/
 */

public class Main {
    /**
     * 思路：
     * 遍历每一颗糖会被吃到哪里
     * 因为前面的会无限制的长高
     * 所以更有可能会阻挡后面的牛吃东西
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 200010;
    static long[] a = new long[N], b = new long[N];
    static int n, m;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        for (int i = 1; i <= n; i++) a[i] = sc.nextInt();
        for (int i = 1; i <= m; i++) b[i] = sc.nextInt();
        // 换一种遍历方式, 遍历每一颗糖
        for (int i = 1; i <= m; i++) {
            long pre = 0;
            for (int j = 1; j <= n; j++) {
                if (pre >= b[i]) break;
                if (a[j] > pre) {
                    long tmp = a[j];
                    a[j] += Math.min(b[i] - pre, a[j] - pre);
                    pre = tmp;
                }
            }
        }
        for (int i = 1; i <= n; i++) out.println(a[i]);
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

